import request from '@/router/axios';
import store from '@/store'
import {
  fenExYuangettoFixed,
  getLineName,
  getStationName,
  getXieChaStatusFormat, sys_data_source_status,
  xieChaStatus
} from "../../../../subwayRat/commonCheck";


export const tableOptionLimit = {
  border: true,
  index: true,
  indexLabel: '序号',
  stripe: true,
  menuAlign: 'center',
  viewBtn: false,
  menu:false,
  editBtn: false,
  emptyBtn:false,
  delBtn: false,
  align: 'center',
  selection: false,
  reserveSelection:false,
  addBtn: false,
  column: [{
    fixed: true,
    label: '主键',
    prop: 'id',
    span: 24,
    hide: true
  }, {
    hide: false,
    label: '线路名称',
    prop: 'lineCode',
    type: 'select',
    search: false,
    cascaderItem: ["stationCode"],
    props: {
      label: 'name',
      value: 'code'
    },
    dicUrl: "/check/check/getLineLists?userCode="+ store.getters.userInfo.userCode,
    display: true // 动态显隐控制不能删除
  }, {
    hide: false,
    label: '站点名称',
    prop: 'stationCode',
    type: 'select',
    search: false,
    dicFlag: false,
    props: {
      label: 'name',
      value: 'code'
    },
    dicUrl: "/check/check/getStationLists?userCode="+ store.getters.userInfo.userCode + "&lineCode={{key}}",
    display: true// 动态显隐控制不能删除
  },{
    label: '收入日期',
    prop: 'incomeTime',
    format: 'yyyy-MM-dd',
    valueFormat: 'yyyy-MM-dd',
    width:150,
    slot:true,
    formslot:true,
    cell: true,
    type: 'date',
    hide: false,
    search: false
  },{
    label: '短款金额',
    prop: 'shortAmount',
    formatter:function(row, value , label, column){
      var num =value / 100;
      num = num.toFixed(2);
      return num;
    },
    search: false,
    hide: false,
    type:'input',
  }, {
    label: '车站人员',
    prop: 'conductorPersonName',
    search: false,
    hide: false,
  }, {
    label: '车站人员工号',
    prop: 'conductorJobNo',
    search: false,
    hide: false,
  }, {
    hide: false,
    label: '通知状态',
    prop: 'noticeState',
    formatter:function(row, value , label, column){
      return value == 1?'通知':'未通知';
    },
    type: 'select',
    search: false
  }, {
    label: '通知人',
    prop: 'noticeName',
    search: false,
    hide: false,
  },{
    hide: false,
    label: '补款状态',
    prop: 'isNotice',
    formatter:function(row, value , label, column){
      return value == 0?'未补款':'已补款';
    },
    type: 'select',
    search: false
  }, {
    hide: false,
    label: '补款日期',
    prop: 'extraMoneyTime',
    format: 'yyyy-MM-dd',
    valueFormat: 'yyyy-MM-dd',
    width: 90,
    type:'date',
    search: false
  }, {
    hide: false,
    label: '补款期限天数',
    prop: 'supPaymentLimit',
    width:160,
    slot:true,
    formslot:true,
    cell: true,
    search: false
  }]
}


/**
 * 车站补款通知列表
 * @param query
 */
export function getSwAuStationShortList(query){
  return  request({
    url: '/check/check/getSwAuStationShortList',
    method: 'post',
    params: query
  });
}
export function getSwAuStationShortLimit(query){
  return  request({
    url: '/check/check/getSwAuStationShortLimit',
    method: 'post',
    params: query,
    data: query
  });
}
export function updateSwAuStationShortLimit(query){
  return  request({
    url: '/check/check/updateSwAuStationShortLimit',
    method: 'post',
    params: query,
    data: query
  });
}


export function noticeSwAuStationShort(query){
  return  request({
    url: '/check/check/noticeSwAuStationShort',
    method: 'post',
    data: query
    //params: query
  });
}


export function setSwAuStationShortAccuntTime(query){
  return  request({
    url: '/check/check/setSwAuStationShortAccuntTime',
    method: 'post',
    params: query
  });
}
